import React, { Component } from 'react'
import { Toast } from 'antd-mobile'
import Ajax from 'lib/Ajax'

export default class Msg extends Component {
	constructor(props) {
    super(props);
    this.state = {
      msgData: {}
    }
    this.searchOption = {}
  }

  componentDidMount(){
    this.fetchMsg(this.props.params.id);
  }

  fetchMsg = (id) => {
    var self = this;
    Ajax({
      url: this.msgApi,
      data: this.searchOption,
      success: function(result){
        self.setState({
          msgData: result
        });
      },
      error: function(error){
        Toast.info(error||'请求失败');
      }
    });
  }

}
